<template>
  <div class="home">
    <h1>home</h1>
    <el-button @click="toUserPage">
      to User
    </el-button>
    {{ name }}
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: 'Home',
  props: ['name'],
  methods: {
    toUserPage() {
      // this.$router.push('/user/2048-hello?name=xx')
      this.$router.push({
        name: 'User',
        params: {
          userId: 'userId - 1024'
          // userId: () => {
          //   console.log(new Date())
          // }
        },
        query: {
          name: 'name - xx'
        }
      })
    }
  },
}
</script>
